package com.cyandpos.pad.refund.presenter;

import android.content.Context;

import com.cyandpos.pad.common.ManagerCardManager.MangerCardData;
import com.cyandpos.pad.refund.contract.RefundYZContract;
import com.cyandpos.pad.refund.model.RefundYZModelImpl;


public class RefundYZPresenterImpl implements RefundYZContract.Presenter,RefundYZContract.Model.OnCompleteListener {

    private RefundYZContract.View mView;
    private RefundYZContract.Model mModel;
    private Context mContext;

    public RefundYZPresenterImpl(RefundYZContract.View view, Context context) {
        mView = view;
        mContext = context;
        mModel = new RefundYZModelImpl();
    }
    @Override
    public void managerCardYZ() {
        mView.showProgress();
        mModel.getData(mView.getManagerNo(),this);
    }

    @Override
    public void onSuccess(MangerCardData managerCard) {
        mView.dismissDialog();
        mView.onSucess(managerCard);
    }

    @Override
    public void onFailure(String errorMsg) {
        mView.dismissDialog();
        mView.showErrMessage(errorMsg);
    }
}
